function jdyd(id, dj) {
	this.c = document.getElementById(id).getContext('2d');
	this.width = document.getElementById(id).width;
	this.height = document.getElementById(id).height;
	this.num = 0;
	this.xs = 0.03;
}

jdyd.prototype = {
	sinz: function() {
		this.c.beginPath();
		this.c.moveTo(0, this.height / 2);
		for(var i = -20; i < 26; i += 0.1) {
			var x = i * 20;
			var y = Math.sin(i) * (this.width / 2 - 50) + this.height / 2;
			this.c.lineTo(x, y);
		}
		this.c.stroke();

		this.c.beginPath();
		this.c.fillStyle = '#fff';
		this.c.arc(this.width / 2, this.height / 2 - 10, 10, 0, 2 * Math.PI, true);
		this.c.fill();

		var x = this.num * 20;
		var y = Math.sin(this.num) * (this.width / 2 - 50) + this.height / 2;
		this.c.beginPath();
		this.c.fillStyle = '#000';
		this.c.arc(x, y, 10, 0, 2 * Math.PI, true);
		this.c.fill();

		this.c.closePath();
	},
	cosz: function() {
		this.c.beginPath();
		this.c.moveTo(this.width / 2, 0);
		for(var i = -20; i < 26; i += 0.1) {
			var x = Math.sin(i) * (this.width / 2 - 50) + this.width / 2;
			var y = i * 20;
			this.c.lineTo(x, y);
		}
		this.c.stroke();

		this.c.beginPath();
		this.c.fillStyle = '#fff';
		this.c.arc(this.width / 2, this.height / 2, 10, 0, 2 * Math.PI, true);
		this.c.fill();

		var y = this.num * 20;
		var x = Math.sin(this.num) * (this.width / 2 - 50) + this.width / 2;
		this.c.beginPath();
		this.c.fillStyle = '#000';
		this.c.arc(x, y, 10, 0, 2 * Math.PI, true);
		this.c.fill();

		this.c.closePath();
	},
	round: function() {
		this.c.beginPath();
		this.c.arc(this.width / 2, this.height / 2, this.width / 2 - 50, 0, 2 * Math.PI, true);
		this.c.stroke();
		this.c.beginPath();
		this.c.arc(this.width / 2, this.height / 2, 10, 0, 2 * Math.PI, true);
		this.c.fillStyle = "#fff";
		this.c.fill();
		var x = Math.cos(this.num) * (this.width / 2 - 50) + this.width / 2;
		var y = Math.sin(this.num) * (this.width / 2 - 50) + this.width / 2;
		this.c.beginPath();
		this.c.fillStyle = '#000';
		this.c.arc(x, y, 10, 0, 2 * Math.PI, true);
		this.c.fill();
		this.c.closePath();
	},
	bxhx: function(o) {
		o.c.clearRect(0, 0, o.width, o.height);
		o.sinz();
		if(o.num > 26) {
			o.num = 0;
		}
		o.num += o.xs;
		setTimeout(function () {
			o.bxhx(o);
		},100);
	},
	bxzx: function(o) {
		o.c.clearRect(0, 0, o.width, o.height);
		o.cosz();
		if(o.num > 26) {
			o.num = 0;
		}
		o.num += o.xs;
		setTimeout(function () {
			o.bxzx(o);
		},100);
	},
	yxyd: function(o) {
		o.c.clearRect(0, 0, o.width, o.height);
		o.round();
		if(o.num > 26) {
			o.num = 0;
		}
		o.num += o.xs;
		setTimeout(function () {
			o.yxyd(o);
		},100);
	}
}